package com.java2302.manufacturing.exception;


import com.auth0.jwt.exceptions.TokenExpiredException;
import com.java2302.manufacturing.vo.ResultVo;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import static com.java2302.manufacturing.vo.ResultVo.INVALID_TOKEN;

@RestControllerAdvice
public class AdminExceptionHandler {

    @ExceptionHandler(TokenExpiredException.class)
    public ResultVo handleTokenExpired(TokenExpiredException e){
        ResultVo result = new ResultVo(INVALID_TOKEN,"token已经失效了",null);
        return result;
    }
}
